Skip to content

Redact OTLP header and Datadog key configs in telemetry#11583

Open
bm1549 wants to merge 6 commits into
masterfrom
brian.marks/omit-sensitive-config-telemetry
Open

Redact OTLP header and Datadog key configs in telemetry#11583
bm1549 wants to merge 6 commits into
masterfrom
brian.marks/omit-sensitive-config-telemetry

Conversation

@bm1549

@bm1549 bm1549 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Renders sensitive configuration values (the OTLP exporter headers, the Datadog API and application keys, the profiling and crash-tracking proxy passwords, and the RUM client token) as <hidden> in configuration telemetry, and marks them sensitive: true in metadata/supported-configurations.json. Redaction matches the configuration property name each value is collected under, and only applies to values that are actually set.

Motivation

These configurations should not be included in configuration telemetry.

Additional Notes

A drift-guard test keeps the redaction list in sync with the sensitive: true entries in the registry.

Contributor Checklist

Jira ticket: N/A

@bm1549 bm1549 added comp: telemetry Telemetry tag: ai generated Largely based on code generated by an AI or LLM type:chore labels Jun 6, 2026
@datadog-datadog-prod-us1

This comment has been minimized.

@bm1549 bm1549 force-pushed the brian.marks/omit-sensitive-config-telemetry branch from 6f11563 to 19f31ad Compare June 6, 2026 01:32
@dd-octo-sts

dd-octo-sts Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.79 s 14.62 s [+0.0%; +2.2%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.57 s 13.64 s [-1.3%; +0.3%] (no difference)
startup:petclinic:appsec:Agent 16.70 s 16.36 s [-2.3%; +6.5%] (no difference)
startup:petclinic:iast:Agent 16.40 s 16.84 s [-6.9%; +1.6%] (no difference)
startup:petclinic:profiling:Agent 15.85 s 16.77 s [-11.4%; +0.4%] (unstable)
startup:petclinic:sca:Agent 16.73 s 16.37 s [-2.3%; +6.6%] (no difference)
startup:petclinic:tracing:Agent 15.63 s 16.03 s [-6.8%; +1.8%] (no difference)

Commit: 4cbc945f · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@bm1549 bm1549 force-pushed the brian.marks/omit-sensitive-config-telemetry branch from 19f31ad to 9639e05 Compare June 8, 2026 21:41
…telemetry

Add the OTLP exporter header configurations and the Datadog API key and
application key configurations to the telemetry configuration filter
list so their values are reported as "<hidden>" in the configuration
telemetry:

- OTEL_EXPORTER_OTLP_HEADERS
- OTEL_EXPORTER_OTLP_TRACES_HEADERS
- OTEL_EXPORTER_OTLP_METRICS_HEADERS
- OTEL_EXPORTER_OTLP_LOGS_HEADERS
- DD_API_KEY
- DD_APPLICATION_KEY (and its DD_APP_KEY alias)

For each configuration, every form that can reach ConfigSetting is
covered: the dotted configuration names (otlp.traces.headers,
otlp.metrics.headers, otlp.logs.headers, application-key, app-key) and
the environment-variable names. Mark these configurations, DD_API_KEY,
and DD_APPLICATION_KEY with "sensitive: true" in
metadata/supported-configurations.json.

Migrate ConfigSettingTest to JUnit 5 and extend it to cover the OTLP
header and application key configurations, including an assertion that
the configured value is not present in the reported telemetry value.
Update ConfigCollectorTest so the application key collected through the
ConfigCollector pipeline is asserted to render as "<hidden>".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bm1549 bm1549 force-pushed the brian.marks/omit-sensitive-config-telemetry branch from 9639e05 to 2c36e1a Compare June 9, 2026 22:21
bm1549 and others added 4 commits June 10, 2026 16:15
…acted

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…to JUnit, redact api-key/profiling collect-path forms, tighten drift guard

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…onfigs

Collect the profiling api key under its property name (single DD_ telemetry
name), reduce CONFIG_FILTER_LIST to the property-name forms values are actually
collected under, and map OTEL headers to their OTLP collected form in the drift
guard. Also mark and redact the remaining collected credential configs: the
profiling and crash-tracking proxy passwords and the RUM client token.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… in Groovy

Remove redaction of the deprecated profiling.api-key/profiling.apikey fallback env
vars (and the getEnvCollectedAs helper they needed). Only redact non-null values, so
an unset sensitive config still reports null rather than <hidden>. Revert
ConfigCollectorTest from JUnit back to its original Groovy form with minimal redaction
edits, and trim the ConfigSettingTest table to a few representative cases.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
// entries in metadata/supported-configurations.json.
private static final Set<String> CONFIG_FILTER_LIST =
new HashSet<>(
Arrays.asList("DD_API_KEY", "dd.api-key", "dd.profiling.api-key", "dd.profiling.apikey"));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to prove that the only format that occurs here is dd.api-key and not DD_API_KEY. Cleaning this up

Comment thread utils/config-utils/src/main/java/datadog/trace/api/ConfigSetting.java Outdated
@bm1549 bm1549 marked this pull request as ready for review June 12, 2026 00:15
@bm1549 bm1549 requested review from a team as code owners June 12, 2026 00:15
@bm1549 bm1549 requested review from PerfectSlayer and removed request for a team June 12, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: telemetry Telemetry tag: ai generated Largely based on code generated by an AI or LLM type:chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant